package org.qcit.com.order.utils

import android.os.Bundle
import com.qcit.common.configs.*

class ProductMenuHelper private constructor(){

    companion object{
    val TYPE = "TYPE"
    val ID = "ID"
    val TITLE = "TITLE"
    val KINDID = "KINDID" //餐品种类id
    val INACTIVITY = "INACTIVITY" //是否是活动中的餐品
    val INSET = "INSET" //是否是套餐
    val PRODUCT_TYPE = 1
    val SERVICE_TYPE = 2
        val instance: ProductMenuHelper by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
            ProductMenuHelper() }

}
    /**
     * 待办订单
     */
    fun getList(pageType:Int): ArrayList<Bundle>? {
        return when(pageType){
            HISTORY -> arrayListOf(getOrderHistory(), getOtherHistory())
            ING -> arrayListOf(getOrderIng(), getOtherIng())
            PAGE -> arrayListOf(getOrderPage(), getOtherPage())
            CANCEL -> arrayListOf(getOrderCancel())
            APPRAISE -> arrayListOf(getOrderAppraise())
            else -> null
        }

    }
    /**
     * 历史订单
     */
    private fun getOrderHistory(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"历史订单")
        bundle.putInt(PAGETYPE, ORDER_HISTORY)
        return bundle
    }
    /**
     * 历史订单
     */
    private fun getOtherHistory(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"历史订单")
        bundle.putInt(PAGETYPE, OTHER_HISTORY)
        return bundle
    }
    /**
     * 待办订单
     */
    private  fun getOrderIng(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"待办订单")
        bundle.putInt(PAGETYPE, ORDER_ING)
        return bundle
    }
    /**
     * 待办订单
     */
    private  fun getOtherIng(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"待办订单")
        bundle.putInt(PAGETYPE, OTHER_ING)
        return bundle
    }
    /**
     * 取消订单
     */
    private fun getOrderCancel(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"取消订单")
        bundle.putInt(PAGETYPE, ORDER_CANCEL)
        return bundle
    }
    /**
     * 评价订单
     */
    private fun getOrderAppraise(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"评价订单")
        bundle.putInt(PAGETYPE, ORDER_APPRAISE)
        return bundle
    }
    /**
     * 首页订单
     */
    private   fun getOrderPage(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"订单")
        bundle.putInt(PAGETYPE, ORDER_PAGE)
        return bundle
    }
    /**
     * 日照首页订单
     */
    private   fun getOtherPage(): Bundle {
        var bundle = Bundle()
        bundle.putString(TITLE,"订单")
        bundle.putInt(PAGETYPE, OTHER_PAGE)
        return bundle
    }
}